<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="height=device-height,width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
<title>订单填写</title>
<link href="<{$ipath}>minisite/hotel/style/hotel_room.css" type="text/css" rel="stylesheet">
<!--<link href="<{$ipath}>public/style/alert_css.css" type="text/css" rel="stylesheet">-->
<!--<script type="text/javascript" src="<{$ipath}>/minisite/hotel/js/My97DatePicker/WdatePicker.js"></script>-->
<script type="text/javascript" src="<{$ipath}>public/js/jquery.js"></script>
<!--加载日历控件start -->
	<script src="<{$ipath}>minisite/hotel/js/choosedate/js/mobiscroll_002.js" type="text/javascript"></script>
	<script src="<{$ipath}>minisite/hotel/js/choosedate/js/mobiscroll_004.js" type="text/javascript"></script>
	<link href="<{$ipath}>minisite/hotel/js/choosedate/css/mobiscroll_002.css" rel="stylesheet" type="text/css">
	<link href="<{$ipath}>minisite/hotel/js/choosedate/css/mobiscroll.css" rel="stylesheet" type="text/css">
	<script src="<{$ipath}>minisite/hotel/js/choosedate/js/mobiscroll.js" type="text/javascript"></script>
	<script src="<{$ipath}>minisite/hotel/js/choosedate/js/mobiscroll_003.js" type="text/javascript"></script>
	<script src="<{$ipath}>minisite/hotel/js/choosedate/js/mobiscroll_005.js" type="text/javascript"></script>
	<link href="<{$ipath}>minisite/hotel/js/choosedate/css/mobiscroll_003.css" rel="stylesheet" type="text/css">
   
<script type="text/javascript">
	$(document).ready(function(e) {
		$(".jiaodian").focus(function(){
			$(".chufa").css("margin-bottom","55px");
			/*$(".chufa").addClass("add_bottom");*/
			})
		$(".jiaodian").blur(function(){
			$(".chufa").css("margin-bottom","0");
			/*$(".chufa").removeClass("add_bottom");*/
			})
    });
	
</script>
</head>

<body>
<!--alert弹窗-->
<div class="alert_box" id="alert_box" style="width:100%; height:100%; background:rgba(0,0,0,0.5); position:fixed; top:0; left:0;z-index:99;display:none;">
	<div class="alert_content" style="width:86%; margin:0 auto; background-color:#fff; border-radius:5px; position:fixed; top:30%; left:7%;">
    	<P class="alert_p" id="alert_p" style="width:90%; padding-top:4%; padding-bottom:4%; line-height:2; text-align:center; color:#292929; font-size:1rem; border-bottom:1px dashed #e3e3e3; margin:0 auto;">我是弹出内容</P>
        <div class="alert_div" style="padding-bottom:6%; width:90%; margin:0 auto;">
        	<p class="quxiao" onClick="alert_quxiao();" style="width:100%; margin:0 auto; padding-top:0.7rem; padding-bottom:0.7rem; color:#FFF; font-size:1.1rem; background-color:#ff7d13; border-radius:5px; text-align:center; margin-top:4%;">确定</p>
        </div>
    </div>
</div>
<!--alert弹窗-->
<div class="bigbox" id="bigbox">
	<!--顶部-->
	<div class="topbox" id="header">
    	<div>
        	<img src="<{$ipath}>minisite/hotel/images/hotel_01.png" onclick="refesh()">
            <p>订单填写</p>
        </div>
    </div>
    <!--酒店信息-->
    <div class="hotel_infor">
    	<p class="hotel_name"><{$hinfo.name}></p>
        <p class="zhu">入住：<span class="green right_span"><{$btim}></span>离店:<span class="green right_span"><{$etim}></span>共<span class="green" id="day"><{$allday}></span>晚</p>
        <!--早餐-->
        <div class="breakfast_box">
        	<P>早餐：<span class="breakfast"><{$isfood}></span></P>
            <P>标准价：<span class="orange">￥</span><span class="orange price" id="price"><{$finfo.pacific_price}></span><{if !empty($dayinfo.w) || !empty($dayinfo.s)}>(含 <{if !empty($dayinfo.w)}><{$dayinfo.w}>天周末<{/if}> <{if !empty($dayinfo.s)}><{$dayinfo.s}>天特殊日<{/if}>)<{/if}></P>
            <P>房型：<span class="room_type"><{$tinfo.name}></span></P>
        </div>
    </div>
    <!--填写部分-->
    <form action="?a=ordersubmit" method="post">
    <div class="flii_box">
    	<p class="flii top_border">
        	<span class="span_left">房间数</span>
            <span class="span_right">
                <{$select}>
            </span>
            
        </p>
        <p class="flii">
        	<span class="span_left">姓名</span>
            <span class="span_right">
                <input name="uname" type="text" onChange="return checkfrm()" id="noName" class="jiaodian" >
            </span>
        </p>
        <p class="flii">
        	<span class="span_left">最晚抵店时间</span>
            <span class="span_right">
                <input type="text" name="ltim" id="appDateTime" onChange="return checkfrm()" class="jiaodian" >
            </span>
        </p>
        <p class="flii chufa">
        	<span class="span_left">联系手机</span>
            <span class="span_right">
                <input name="mob" type="text" onChange="return checkfrm()"  id="noPhone" class="jiaodian">
            </span>
        </p>
    </div>
    <!--注意事件-->
    <!--<div class="notice_box">
    	<P class="p_04">注意事件</P>
        <p class="p_05">城市重要通知：目前北京全程禁烟，酒店均无烟房北京首都机场希尔顿酒店承诺到店无房赔付首晚</p>
    </div>-->
    <!--底部按钮-->
    <div class="bottom_button">
    	<span class="span01"><!--开--><span class="e">订单总额</span><span class="orange price_left">￥</span><!--<span class="orange" id="total"><{$price}></span>--><!--开--><span><input type="text" disabled id="total01" class="orange in_po"></span><!--开--></span><!--开--></span><input type="submit" class="span02" value="提交订单" id="ti" onClick="return checkfrm();" >
        <input type="hidden" value="<{$price}>" id="total" class="orange">
        <input type="hidden" id="allprice" name="allprice" value="<{$price}>" />
        <input type="hidden" id="btim" name="btim" value="<{$btim}>" />
        <input type="hidden" id="etim" name="etim" value="<{$etim}>" />
        <input type="hidden" id="tid" name="tid" value="<{$finfo.tid}>" />
        <input type="hidden" id="fid" name="fid" value="<{$finfo.id}>" />
        <!--<input type="hidden" id="default" value="" />-->
        
    </div>
    </form>
</div>
<script>
function getTotal(){
	var b=document.getElementById("total").value;
	/*alert(b);*/
	var c=document.getElementById("select").value;
	/*alert(c);*/
	var d=parseFloat(b)*parseFloat(c);//parseInt返回一个整数
	/*alert(d); */
	var mineprice=document.getElementById("allprice").value=d;

	if(c>0){
		/*$("#total").hide();*/
		/*$("#total01").css("display","inline");*/
		document.getElementById("total01").value=mineprice;
		}
	checkfrm();
}
getTotal();
checkfrm();




//点击弹出框取消
	function alert_show(str){
		document.getElementById("alert_p").innerHTML=str;
		document.getElementById("alert_box").style.display="block";
		}
	function alert_quxiao(str){
		document.getElementById("alert_box").style.display="none";
		}
	function isMobel(value)
		{
			if(/^13\d{9}$/g.test(value)||(/^15\d{9}$/g.test(value))||(/^17\d{9}$/g.test(value))|| (/^18\d{9}$/g.test(value)))
			{ return false; }
			else
			{ return true; }
		};
	function checkfrm(){
        var no01=$("#select").val();
		
		var no02=$("#noName").val();
		
		var no03=$("#appDateTime").val();
		
		var no04=$("#noPhone").val();
		var e=document.getElementById("bigbox");
		if(no01=='' || no01==0 ||no02==''||no03==''||no04==''){
			$("#ti").removeClass("add_orange");
			$("#ti").addClass("add_grey");
			$("#ti").prop("disabled","disabled");
			return false;
			}
		else if(no01!=='' && no01!==0 &&no02!==''&&no03!==''&&no04!==''){
				
				//请输入正确的手机号码
				
				if(isMobel(no04)){
					alert_show("请正确填写手机号码!");
					return false;
				}
				$("#ti").removeClass("add_grey");
				$("#ti").addClass("add_orange");
				$("#ti").removeAttr("disabled");
				}
	}
	function refesh(){
		window.history.go(-1);
		//window.location.reload();
		//window.location.href='http://kaifa.zq.zhongsou.com/minisite/hotel/?a=booking&hid=1';
	}
	//加载中... ...
	$(function () {
		var currYear = (new Date()).getFullYear();		
		$("#appDateTime").mobiscroll().datetime({
			theme: 'android-ics light', //皮肤样式
			display: 'modal', //显示方式
			mode: 'scroller', //日期选择模式
			dateFormat: 'yyyy-mm-dd',
			lang: 'zh',
			nowText: "今天",
			startYear: currYear, //开始年份
			endYear: currYear+1, //结束年份
			stepMinute: 1,
			onSelect:function(){
			var now = new Date();
			var nowY = now.getFullYear();
			var nowM = now.getMonth()+1;
			var nowD = now.getDate();
			var nowCurr = new Date(nowY,nowM,nowD).getTime();
			var sele = $(this).val().substring(0,10);
			var seleTime = sele.split('-');
			var seleCurr =  new Date(seleTime[0],seleTime[1],seleTime[2]).getTime();
			if(seleCurr<nowCurr){
				
			alert_show("不能选择更早的时间哦！请重新选择");	
			$(this).val('');	
				}
				
			}})
	});
	//微信去头
	window.onload = function() { 
	var ua = navigator.userAgent.toLowerCase();
	if(ua.match(/MicroMessenger/i) == "micromessenger"){
		 document.getElementById("header").style.display="none";
	}
	}; 


</script>
</body>
</html>
